package com.ss.android.common.app;

import android.app.Application;
import android.content.Context;
import android.content.Intent;

import com.ss.android.common.AppContext;

public abstract class AbsApplication extends Application implements AppContext {
    public static AbsApplication sApp;
    private static Context sRef;

    public AbsApplication() {

    }

    public void onCreate() {
        super.onCreate();
        AbsApplication.sRef = this;
    }

    public void startActivity(Intent intent) {
        if ((intent.getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK) == 0) {
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        }
        super.startActivity(intent);
    }

    public static AbsApplication getApplication() {
        return AbsApplication.sApp;
    }

    public static Context getCtx() {
        return AbsApplication.sRef;
    }
}

